package com.fc.entity.input;

import com.fc.checkGroup.Insert;
import com.fc.checkGroup.Update;
import io.swagger.v3.oas.annotations.media.Schema;
import jakarta.validation.constraints.NotBlank;
import jakarta.validation.constraints.NotNull;
import jakarta.validation.constraints.Pattern;
import lombok.Data;

@Data
public class AddressInput {

    @Schema(title = "id")
    @NotNull(message = "id不能为空", groups = Update.class)
    private Long id;

    @Schema(title = "收件人")
    @NotBlank(message = "收件人不能为空", groups = {Insert.class, Update.class})
    private String consignee;

    @Schema(title = "联系电话")
    @NotBlank(message = "联系电话不能为空", groups = {Insert.class, Update.class})
    @Pattern(regexp = "^(|\\d{3}-\\d{8}|\\d{4}-\\d{7,8}|1[3-9]\\d{9})$", message = "手机号格式不正确", groups = {Insert.class, Update.class})
    private String phoneNumber;

    @Schema(title = "省级区划编号")
    private String provinceCode;

    @Schema(title = "省级名称")
    @NotBlank(message = "省级名称不能为空", groups = {Insert.class, Update.class})
    private String provinceName;

    @Schema(title = "市级区划编号")
    private String cityCode;

    @Schema(title = "市级名称")
    @NotBlank(message = "市级名称不能为空", groups = {Insert.class, Update.class})
    private String cityName;

    @Schema(title = "区级区划编号")
    private String districtCode;

    @Schema(title = "区级名称")
    @NotBlank(message = "区级名称不能为空", groups = {Insert.class, Update.class})
    private String districtName;

    @Schema(title = "详细地址")
    @NotBlank(message = "详细地址不能为空", groups = {Insert.class, Update.class})
    private String detail;

    @Schema(title = "标签（如家庭、公司等）")
    private String label;

    @Schema(title = "是否默认地址，0 否，1 是")
    private Boolean isDefault;
}
